import http from '@/utils/http/axios'
import {ContentTypeEnum} from '@/enums/httpEnum'

enum Api {
    templateList = '/template/list',
    templateCreate = '/template/create',
    templateDelete = '/template/delete',
    templateUpdate = '/template/update',
    templateScanList = '/template/scanlist',
    templateNewScan = '/template/newscan'
}

/**
 * @description: 修改
 */
export function templateUpdate(params: any) {
    return http.request({
        url: Api.templateUpdate,
        method: 'POST',
        params,
    },{
        isTransformRequestResult: false,
        isShowMessage: true,
        successMessageText: '修改成功',
        errorMessageText: '修改失败'
    })
}

/**
 * @description: 删除
 */
export function templateDelete(params: any) {
    return http.request({
        url: Api.templateDelete,
        method: 'POST',
        params,
    },{
        isTransformRequestResult: false,
        isShowMessage: true,
        successMessageText: '删除成功',
        errorMessageText: '删除失败'
    })
}

/**
 * @description: 添加
 */
export function templateCreate(params: any) {
    return http.request({
        url: Api.templateCreate,
        method: 'POST',
        params,
    },{
        isTransformRequestResult: false,
        isShowMessage: true,
        successMessageText: '添加成功',
        errorMessageText: '添加失败'
    })
}

/**
 * @description: 获取
 */
export function templateList(params: any) {
    return http.request({
        url: Api.templateList,
        method: 'GET',
        params,
    },{
        isTransformRequestResult: false
    })
}

export function scanList(params: any){
    return http.request({
        url:Api.templateScanList,
        method: "POST",
        params,
    },{
        isTransformRequestResult: false
    })
}

export function newScan(params: any){
    return http.request({
        url:Api.templateNewScan,
        method: "POST",
        params,
    },{
        isTransformRequestResult: false
    })
}
